package com.tledu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author cyrus
 */
@RequestMapping("/student")
//@Controller
//@ResponseBody
@RestController // == @Controller + @ResponseBody
public class StudentController {

//    @RequestMapping(value = "",method = RequestMethod.POST)
    @PostMapping
//    @ResponseBody
    public String insert() {
        System.out.println("新增");
        return "insert";
    }

//    @RequestMapping(value = "",method = RequestMethod.GET)
    @GetMapping
//    @ResponseBody
    public String detail() {
        System.out.println("详情");
        return "detail";
    }

//    @RequestMapping(value = "",method = RequestMethod.DELETE)
    @DeleteMapping
//    @ResponseBody
    public String delete() {
        System.out.println("删除");
        return "delete";
    }

//    @RequestMapping(value = "",method = RequestMethod.PUT)
    @PutMapping
//    @ResponseBody
    public String update() {
        System.out.println("修改");
        return "update";
    }
}
